﻿using System;
using Models;
using System.Collections.Generic;
namespace Client.AdminHome.FunctionalServices
{
    public static class AdminHomeServices
    {
        
        public static String displayAccountDetails(String UserName)
        {
            var data = MVCSiteJDG.Dao.DataAccess.Reader.readAccountDetails(UserName);
            var returnThis = " name = " + data[0] + "registration date" + data[1] + "last login" + data[2] + "email" + data[3];
            
            return returnThis;
        }
        
        public static String displayProductList(int minRange, int maxRange)
        {
            var data = MVCSiteJDG.Dao.DataAccess.Reader.getProductList(minRange, maxRange);
            var writeThisAsHtml = "<table>";
            writeThisAsHtml += "<tr><td>Image</td><td>Cat</td><td>Product</td><td>name</td><td>description</td><td>indate</td>";
            var i = 0;
            while (i < data.Count)
            {
                writeThisAsHtml += "<tr><td>" + data[i][3] + "</td><td>"+ data[i][5]  +"<td></td>" + data[i][6] + "</td> <td>" + data[i][0] + "</td> <td>" + data[i][1] + "</td> <td>" + data[i][4] + "</td><td><input name=" + data[i][7] + " type=\"checkbox\"></input></td></tr>";
                i++;
            }

            writeThisAsHtml += "</table>";
            return writeThisAsHtml;

        }

        

    }

}

